package com.angel.architecture.persistence.beans;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;

import java.io.Serializable;


public class Menu implements Serializable {

    /**
	 *
	 */
	private static final long serialVersionUID = -967890942978065965L;

	/** identifier field */
    private Long id;

    /** persistent field */
    private Long menuSuperior;

    /** persistent field */
    private String descripcion;

    /** persistent field */
    private Float orden;

    /** full constructor */
    public Menu(java.lang.Long menusuperior, java.lang.String descripcion, java.lang.Double orden) {
        this.menuSuperior = menusuperior;
        this.descripcion = descripcion;
        this.setOrden(orden);
    }
    public Menu(java.lang.Long menusuperior, java.lang.String descripcion, java.lang.Float orden) {
        this(menusuperior, descripcion, new Double(orden.doubleValue()));
    }

    public Menu(java.lang.String id, java.lang.String menusuperior, java.lang.String descripcion, java.lang.Double orden) {
		if (id != null && !"".equalsIgnoreCase(id.trim())) {
		  this.id = new Long(id);
		}
		this.menuSuperior = new Long(menusuperior);
		this.descripcion = descripcion;
        this.setOrden(orden);
	}
    public Menu(java.lang.String id, java.lang.String menusuperior, java.lang.String descripcion, Float orden) {
        this(id, menusuperior, descripcion, new Double(orden.doubleValue()));
    }

	public Menu(java.lang.String descripcion) {
		this.descripcion = descripcion;
	}


    /** default constructor */
    public Menu() {
    }

    public java.lang.Long getId() {
        return this.id;
    }

    public void setId(java.lang.Long id) {
        this.id = id;
    }

    public java.lang.Long getMenuSuperior() {
        return this.menuSuperior;
    }

    public void setMenuSuperior(java.lang.Long menusuperior) {
        this.menuSuperior = menusuperior;
    }

    public java.lang.String getDescripcion() {
        return this.descripcion;
    }

    public void setDescripcion(java.lang.String descripcion) {
        this.descripcion = descripcion;
    }

    public java.lang.Float getOrden() {
        return this.orden;
    }
    public void setOrden(java.lang.Float orden) {
        this.orden = orden;
    }
    public void setOrden(java.lang.Double orden) {
        this.orden = new Float(orden.doubleValue());
    }

    public String toString() {
        return new ToStringBuilder(this)
            .append("id", getId())
            .toString();
    }

    public boolean equals(Object other) {
        if ( !(other instanceof Menu) ) return false;
        Menu castOther = (Menu) other;
        return new EqualsBuilder()
            .append(this.getId(), castOther.getId())
            .isEquals();
    }

    public int hashCode() {
        return new HashCodeBuilder()
            .append(getId())
            .toHashCode();
    }

}
